package com.linshengjian.power.entity;

import com.linshengjian.core.BaseEntity;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToMany;
import java.util.HashSet;
import java.util.Set;

@Accessors(chain = true)
@Data
@Entity(name = "role")
public class RoleEntity extends BaseEntity<Integer> {

    @Column(nullable = false)
    private String name;

    private String description;

    @Column(columnDefinition = "boolean default true")
    private Boolean status = true;

    @ManyToMany
    private Set<PermissionEntity> permissions = new HashSet<>();

}
